package com.situ.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.situ.domain.entity.TCart;
import com.situ.domain.entity.TCartExample;
import com.situ.domain.vo.CartListVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface TCartMapper extends BaseMapper<TCart> {
    long countByExample(TCartExample example);

    int deleteByExample(TCartExample example);

    int deleteByPrimaryKey(Integer cid);

    int insert(TCart record);

    int insertSelective(TCart record);

    List<TCart> selectByExample(TCartExample example);

    TCart selectByPrimaryKey(Integer cid);

    int updateByExampleSelective(@Param("record") TCart record, @Param("example") TCartExample example);

    int updateByExample(@Param("record") TCart record, @Param("example") TCartExample example);

    int updateByPrimaryKeySelective(TCart record);

    int updateByPrimaryKey(TCart record);

    /**
     * 根据用户id查询购物车列表
     * @param userId
     * @return
     */
    List<CartListVO> getCartList(Integer userId, List<Integer> cids);
}